home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 352_01 / strppfnt.cpp < prev    next >
C/C++ Source or Header  |  1991-04-28  |  562b  |  24 lines

  1. // STRPPFNT.CPP        contains String::findNot() 
  2. //        routine finds first occurance in 'this' of any char not in string A
  3. //        obeys String::caseSens
  4. #include <stdlib.h>
  5. #include <string.h>
  6.  
  7. #include "dblib.h"
  8.  
  9. int String::findNot ( char *a )
  10.      {
  11.     int na = strlen (a);
  12.     
  13.     if ( a== NULL || na==0 ) return 0;
  14.     
  15.     int sn = n;
  16.     char *ss = s;
  17.     for ( int i=0; i<sn; ++i )
  18.         {
  19.         // examine each letter in String 'this',  for any char not in pattern a.
  20.         if ( -1 == String::findchr(a, na, ss[i]) ) return i;
  21.         }
  22.     return -1;
  23.     }            // end String::findNot()
  24.